package me.itsoo.elasticbatis.session;

import me.itsoo.elasticbatis.binding.MapperRegistry;
import me.itsoo.elasticbatis.executor.Executor;

/**
 * SqlSessionFactory
 *
 * @author zhangxy4
 * @version 0.0.1
 * @since 2025/4/3
 */
public class SqlSessionFactory {

    private final Configuration configuration;
    private final MapperRegistry mapperRegistry;

    public SqlSessionFactory(Configuration configuration) {
        this.configuration = configuration;
        this.mapperRegistry = configuration.getMapperRegistry();
    }

    public SqlSession openSession() {
        Executor executor = new Executor();
        return new SqlSession(configuration, executor);
    }
}
